package timing.ukulele.common.dictionary;

import java.util.Arrays;

/**
 * 系统用户标识
 * @author admin
 */
public enum UserLabelEnum {
    OPERATOR("operator", "运维"),
    PLATFORM("platform", "平台"),
    ORG("org", "组织"),
    USER("user", "用户");


    private String value;

    private String description;

    UserLabelEnum(String value, String description) {
        this.value = value;
        this.description = description;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public static Boolean hasValue(String value) {
        long count = Arrays.stream(values()).filter(item -> item.value.equals(value)).count();
        return count > 0;
    }
}
